from django import template

register = template.Library()

from abstract.views import *
import abstract.tracked as tracked

# tagged

def get(kw, name):
	return kw.get(name, None)

register.filter('get', get)

def probe_tag(nodo, t):
	return nodo.probe_tag(t)

register.filter('probe_tag', probe_tag)

register.filter('gettag', lambda nodo,t: nodo.gettag(t))

register.filter('xgettag', lambda nodo,spath: nodo.xgettag(*spath.split('/')))

register.filter('hastag', lambda nodo,t: nodo.hastag(t)) 


# tracked

register.filter('formatdatetime', tracked.formatdatetime)
register.filter('formatdate', tracked.formatdate)
register.filter('formattime', tracked.formattime)
